package com.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.base.mapper.voipmapper.NewsMapper;
import com.base.po.sqlparam.NewsExamplePage;
import com.base.po.voip.News;
import com.base.po.voip.NewsExample;
import com.base.service.NewsService;
import com.base.utils.Page;

@Service("newsService")
public class NewsServiceImpl implements NewsService {
	@Autowired
	private NewsMapper newsMapper;

	@Override
	public int countByExample(NewsExample example) {
		return newsMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(NewsExample example) {
		return newsMapper.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		return newsMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(News record) {
		return newsMapper.insert(record);
	}

	@Override
	public int insertSelective(News record) {
		return newsMapper.insertSelective(record);
	}

	@Override
	public List<News> selectByExample(NewsExample example) {
		return newsMapper.selectByExample(example);
	}

	@Override
	public News selectByPrimaryKey(String id) {
		return newsMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByExampleSelective(News record, NewsExample example) {
		return newsMapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(News record, NewsExample example) {
		return newsMapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(News record) {
		return newsMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(News record) {
		return newsMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<News> selectByExamplePage(NewsExamplePage examplePage) {
		return newsMapper.selectByExamplePage(examplePage);
	}

	@Override
	public int selectByPK(String pk, String createtime) {
		return newsMapper.selectByPK(pk, createtime);
	}
	
	@Override
	public List<News> selectByAll(Page page, Integer category, String title, String from, String dateFrom,
			String dateTo) {
		
		return newsMapper.selectByAll(page, category, title, from, dateFrom, dateTo);
	}

	@Override
	public int countByAll(Integer category, String title, String from, String dateFrom, String dateTo) {
		
		return newsMapper.countByAll(category, title, from, dateFrom, dateTo);
	}

	@Override
	public int updateDataStatusByID(String id, Integer datastatus) {
		
		return newsMapper.updateDataStatusByID(id, datastatus);
	}

	@Override
	public List<News> selectByCategory(Page page, Integer toutiao, Integer shehui, Integer guonei, Integer guoji,
			Integer yule, Integer tiyu, Integer junshi, Integer keji, Integer caijing, Integer shishang, Integer youxi,
			Integer qiche, Integer xiaohua, Integer jiankang, Integer jiaju, Integer xingzuo, Integer lishi,
			Integer zatan, String title, String from, String dateFrom, String dateTo) {
		
		return newsMapper.selectByCategory(page, toutiao, shehui, guonei, guoji, yule, tiyu, junshi, keji, caijing, shishang, youxi, qiche, xiaohua, jiankang, jiaju, xingzuo, lishi, zatan, title, from, dateFrom, dateTo);
	}

	@Override
	public int countByCategory(Integer toutiao, Integer shehui, Integer guonei, Integer guoji, Integer yule,
			Integer tiyu, Integer junshi, Integer keji, Integer caijing, Integer shishang, Integer youxi, Integer qiche,
			Integer xiaohua, Integer jiankang, Integer jiaju, Integer xingzuo, Integer lishi, Integer zatan,
			String title, String from, String dateFrom, String dateTo) {
		
		return newsMapper.countByCategory(toutiao, shehui, guonei, guoji, yule, tiyu, junshi, keji, caijing, shishang, youxi, qiche, xiaohua, jiankang, jiaju, xingzuo, lishi, zatan, title, from, dateFrom, dateTo);
	}
}
